<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Submit Code</title>         
    </head>
    <body>
        <div class="body">
            <div class="leftcolumn">
               <g:form action="save" method="post" >
               <h1>Submit Code</h1>
               <g:if test="${flash.message}">
                    <div class="message">${flash.message}</div>
               </g:if>
               <g:hasErrors bean="${code}">
                    <div class="errors">
                         <g:renderErrors bean="${code}" as="list" />
                    </div>
               </g:hasErrors>
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="title">Title:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:code,field:'title','errors')}">
                                    <input type="text" id="title" name="title" value="${fieldValue(bean:code,field:'title')}"/>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="language">Language:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:code,field:'language','errors')}">
                                    <g:select id="language" name="language" from="${code.constraints.language.inList}" value="${code.language}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="codeString">Content:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:code,field:'codeString','errors')}">
                                    <textarea rows="5" cols="40" name="codeString">${fieldValue(bean:code, field:'codeString')}</textarea>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create" /></span>
                </div>
            </g:form>
            </div>     
        </div>
    </body>
</html>
